// Parse.h: interface for the CParse class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PARSE_H__963C0E07_98C6_41E3_B4FF_EA432FECF8D1__INCLUDED_)
#define AFX_PARSE_H__963C0E07_98C6_41E3_B4FF_EA432FECF8D1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//##ModelId=450DFB6703B9
class CParse  
{
public:
	//##ModelId=450DFB6703BA
	CParse(CString sText = "");
	//##ModelId=450DFB6703BC
	virtual ~CParse();

	//##ModelId=450DFB6703BE
	void Init(CString sText);
	//##ModelId=450DFB6703C0
	void InsertQueryElement(CString sName, HTMLELEMENT& htmlElement);
	//##ModelId=450DFB680002
	HTMLELEMENT RemoveQueryElement(CString sName);
	//##ModelId=450DFB680004
	CString operator [](CString sName);
	//##ModelId=450DFB68001F
	CString GetAt(CString sName);
	//##ModelId=450DFB680021
	long Execute();
	long GetTitleAndDes();

	long GetAllLinks(CString sBaseUrl, map<CString, CString>& mapUrlLinks, 
		CString sUrlInclude = "", CString sUrlInclude2 = "", CString sUrlInclude3 = "");

	static long GetURL(CString sUrl, CString& sHtml);
	static long GetAllLinksByText(CString sBaseUrl, CString& sHtml, list<CString>& incStrs, list<CString>& excStrs, map<CString, CString>& mapUrlLinks);
	static long GetAllLinksByScript(CString sBaseUrl, CString& sHtml, list<CString>& incStrs, list<CString>& excStrs, map<CString, CString>& mapUrlLinks);

	long GetAllObjects(CComPtr<IHTMLDocument2> pDoc, CString sBaseUrl, map<CString, CString>& mapUrlLinks, 
		CString sUrlInclude = "", CString sUrlInclude2 = "", CString sUrlInclude3 = "");

	static void CParse::RemoveHtmlTag(CString& sValue, int nStart = 0);
	static void CParse::RemoveUBBTag(CString& sValue);
	static void ReviseURL(CString& sURL);
	static void CheckURL(CString& sRootUrl, CString& sBaseUrl, CString& sURL, CString& sURN);
	static bool TestCanAdd(CString& sURL, CString& sURN, list<CString>& incStrs, list<CString>& excStrs);
	
private:
	//##ModelId=450DFB680022
	CString m_sText;
	//##ModelId=450DFB68011C
	map<CString, HTMLELEMENT> m_mapElement;
};

#endif // !defined(AFX_PARSE_H__963C0E07_98C6_41E3_B4FF_EA432FECF8D1__INCLUDED_)
